package com.designmodel.designmodel.Factory_Pattern_工厂模式;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
	public static void main(String[] args) {
//		ApplicationContext context= new ClassPathXmlApplicationContext("services.xml");
//		Object userInfo = context.getBean("userInfo");
//		User user=(User) userInfo;
//		System.out.println(user.getName()+"------"+user.getSex());


		BeanFactory beanFactory=new BeanFactory();
		Object o=beanFactory.getBean("userInfo");
		User user=(User) o;
		System.out.println(user.getName()+"------"+user.getSex());
	}
}
